﻿using LVYAN.Model;
using System.Collections.Generic;
using System.Linq;
namespace LVYAN.Service
{
    /// <summary>
    /// 
    /// </summary>
    public class AIJQRManGroup
    {
        
        /// <summary>
        ///转发接受者
        /// </summary>
        /// <returns></returns>
        public string GetReceiverRoomName(string ReceiverName, string GroupName)
        {
            if (ReceiverName == GroupName) return "";
            return ReceiverName;
        }
        /// <summary>
        ///处理越界关键词
        /// </summary>
        /// <returns></returns>
        public string OptSensitive(List<KeyWordModel> List, string Data)
        {
            Data = Data.Replace("：", ": ");
            foreach (var item in List)
            {
                Data = Data.Replace(item.Key, item.Value);
            }
            return Data;
        }
        /// <summary>
        ///存在敏感词时直接反馈
        /// </summary>
        /// <returns></returns>
        public bool OptRes(List<KeyWordModel> List, string Data)
        {
            return List.Any(t => Data.Contains(t.Key,System.StringComparison.OrdinalIgnoreCase));

        }
    }
}
